Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preset-vue #2143

Merged
merged 13 commits into from
Jul 8, 2024
Merged

fix: preset-vue #2143

merged 13 commits into from
Jul 8, 2024

Conversation

jeffwcx
Copy link
Collaborator

@jeffwcx jeffwcx commented Jun 14, 2024

🤔 这个变动的性质是?/ What is the nature of this change?

  • 新特性提交 / New feature
  • bug 修复 / Fix bug
  • 样式优化 / Style optimization
  • 代码风格优化 / Code style optimization
  • 性能优化 / Performance optimization
  • 构建优化 / Build optimization
  • 网站、文档、Demo 改进 / Website, documentation, demo improvements
  • 重构代码或样式 / Refactor code or style
  • 测试相关 / Test related
  • 其他 / Other

🔗 相关 Issue / Related Issue

#2141

💡 需求背景和解决方案 / Background or solution

  • preset-vue引入的问题

    • webpack 配置导致的@makotot/ghostui/src/Scrollspy 引入问题(即从node_modules引入tsx)
      更改为
    import { Scrollspy as ScrollSpy  } from "@makotot/ghostui"
    • repository 空字段问题
  • mfsu 依赖搜集机制所导致的vue及外部依赖产生多个实例

mfsu: {
 shared: {
   ...msfuConfig.shared,
   vue: { singleton: true },
 },
},
  • 每个demo传给live compiler的filename需唯一
  • 最新版的vue的泛型组件类型有更改,需要支持

@PeachScript @Jinbao1001

📝 更新日志 / Changelog

Language Changelog
🇺🇸 English fix preset-vue
🇨🇳 Chinese 修复preset-vue

Copy link

vercel bot commented Jun 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dumi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 4:35pm

@jeffwcx jeffwcx changed the title [WIP] fix: preset-vue fix: preset-vue Jun 14, 2024
@Jinbao1001
Copy link
Member

+1

@@ -188,7 +188,7 @@ export const demos = {
// omit entry file
...(key !== entryFileName
? {
[key]: `{{{require('${path}')}}}`,
[key]: `{{{import('${path}')}}}`,
Copy link
Member

@PeachScript PeachScript Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个方案感觉不太好,会导致依赖变异步,以及不必要的 chunk 拆分;还不如在这里对 path 重新 resolve 一遍

cc @Jinbao1001

Copy link
Collaborator Author

@jeffwcx jeffwcx Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里暂时的异步没关系吧,expandDemoContext 那里会await一下。chunk拆分倒是没考虑到。

const resolver = enhancedResolve.create.sync({
mainFields: ['browser', 'module', 'main'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
conditionNames: ['import', 'default', 'browser'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conditionNames要不要和项目已有保持一致: ['import', 'require', 'default', 'browser', 'node']

@Jinbao1001 Jinbao1001 merged commit 4ab098a into master Jul 8, 2024
9 checks passed
@Jinbao1001 Jinbao1001 deleted the fix/2141 branch July 8, 2024 06:10
Jinbao1001 added a commit that referenced this pull request Jul 12, 2024
Jinbao1001 pushed a commit that referenced this pull request Jul 12, 2024
* fix: repository field may be empty

* fix: give unique filename for each demo

* fix: limit the resolve rule to the demo

* fix: vue jsx import isssue

* fix: multi vue instance issue in mfsu mode

* chore: remove comments

* feat: support lastest vue

* fix: vue live demo

* feat: using import instead of require for demo context

* fix: use singleton vue

* refactor: avoid unnecessary chunk split
@lifegit
Copy link

lifegit commented Jul 29, 2024

+1, currently still exists.

fatal - TypeError: Cannot read properties of undefined (reading 'directory')
at Hook.fn (/ui-pro/node_modules/.pnpm/@[email protected]_dumi@2.4.7_@babel+core@7.24.7_@swc+helpers@0.5.1_@types[email protected]__s4uoca4yeixx4ez3l74iass7zu/node_modules/@dumijs/preset-vue/dist/common.js:42:91)
at /ui-pro/node_modules/.pnpm/@umijs[email protected]/node_modules/@umijs/core/dist/service/service.js:136:38
at _next10 (eval at create (/ui-pro/node_modules/.pnpm/@umijs[email protected]/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:8410), :85:18)
at eval (eval at create (/ui-pro/node_modules/.pnpm/@umijs[email protected]/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:8410), :110:1)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
fatal - A complete log of this run can be found in:
fatal - /ui-pro/myapp/node_modules/.cache/logger/umi.log
fatal - Consider reporting a GitHub issue on https://github.com/umijs/umi/issues

@jeffwcx jeffwcx mentioned this pull request Sep 20, 2024
10 tasks
Jinbao1001 pushed a commit that referenced this pull request Sep 20, 2024
* fix: preset-vue (#2143)

* fix: repository field may be empty

* fix: give unique filename for each demo

* fix: limit the resolve rule to the demo

* fix: vue jsx import isssue

* fix: multi vue instance issue in mfsu mode

* chore: remove comments

* feat: support lastest vue

* fix: vue live demo

* feat: using import instead of require for demo context

* fix: use singleton vue

* refactor: avoid unnecessary chunk split

* fix: illegal characters in the path under Windows

`:` should not allowed to be contained in `api.key` cause it may be used in `api.writeTmpFile`

#2188

* fix: the include/exclude in webpack needs to correspond to the path format of the system
Jinbao1001 pushed a commit that referenced this pull request Oct 10, 2024
* fix: preset-vue (#2143)

* fix: repository field may be empty

* fix: give unique filename for each demo

* fix: limit the resolve rule to the demo

* fix: vue jsx import isssue

* fix: multi vue instance issue in mfsu mode

* chore: remove comments

* feat: support lastest vue

* fix: vue live demo

* feat: using import instead of require for demo context

* fix: use singleton vue

* refactor: avoid unnecessary chunk split

* fix: illegal characters in the path under Windows

`:` should not allowed to be contained in `api.key` cause it may be used in `api.writeTmpFile`

#2188

* fix: the include/exclude in webpack needs to correspond to the path format of the system

* feat: add basic vue lib template

* feat: improve vue tempalte

* fix: template test file impact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants